%h4= s_('ProjectSettings|Analytics Dashboards')
%p
  = s_('ProjectSettings|Select the project containing Analytics Dashboards configuration files.')
  = link_to(s_('ProjectSettings|What is Analytics Dashboards?'), help_page_path('user/analytics/value_streams_dashboard.md'))

.settings-content#js-analytics-dashboards-settings
  = gitlab_ui_form_for @project, html: { class: 'fieldset-form', data: { testid: 'analytics-dashboards-settings' } } do |form|
    = form_errors(@project)

    %fieldset
      .form-group
        - pointer = @project.analytics_dashboards_pointer || @project.build_analytics_dashboards_pointer
        = form.fields_for :analytics_dashboards_pointer_attributes, pointer do |pointer_form|
          = pointer_form.hidden_field :id
          .js-vue-project-select{ data: { label: s_('ProjectSettings|Select a project'),
              input_name: 'project[analytics_dashboards_pointer_attributes][target_project_id]',
              input_id: 'project_analytics_dashboards_pointer_attributes_project_id',
              group_id: @project.root_namespace.id,
              order_by: 'last_activity_at',
              with_shared: true.to_s,
              include_subgroups: true.to_s,
              clearable: true.to_s,
              selected: pointer.target_project_id } }

    = form.submit _('Save changes'), pajamas_button: true
